
/**
 * @User: Alan
 * @Date: 2019/8/20
 * @Time: 10:10
 * @Description: hello
 * @Version: 1.0
 * 打印机
 */

public class MessagePrinter {
    public MessagePrinter() {
        super();
        System.out.println("MessagePrint...");
    }

    /**
     *建立和Message的关联关系
     */
    private MessageService service;
    /**
     *设置Service的值
     * @param service
     */
    public void setService(MessageService service) {
        this.service = service;
    }


    public void printMessage(){
        System.out.println(this.service.getMessage());

    }
}
